package com.kingmed.kmss.common.exception;


import com.kingmed.kmss.common.enums.base.code.IResultCode;
import com.kingmed.kmss.common.utils.MessageUtils;

/**
 * 集成message.properties异常(内部)
 */
public class MessageException extends RuntimeException {
    /**
	 * 
	 */
	private static final long serialVersionUID = -4830173219306183990L;
	private IResultCode resultCode;

    public MessageException(IResultCode resultCode) {
        super(resultCode.getMessage());
        this.resultCode = resultCode;
    }

    public MessageException(String msgKey, Object... args) {
        super(MessageUtils.message(msgKey, args));
    }
    
    public MessageException(String msgKey) {
        super(MessageUtils.message(msgKey));
    }

    public MessageException(Throwable cause) {
        super(cause);
    }

    public MessageException(String message, Throwable cause) {
        super(message, cause);
    }

    public IResultCode getErrorCode() {
        return resultCode;
    }
}
